home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-15 | 2.0 KB | 62 lines | [TEXT/ToyS] |
- tell application "UltraFind 2.1"
- clear
- set the text of fileName of its searchRoutine to "untitled"
- set the searchType of fileName of its searchRoutine to nameContains
- set the fileKind of its searchRoutine to filesAndFolders
- scan
- end tell
-
- copy the result to numFiles
-
- if numFiles is greater than 0 then
- set dialogText to "Found " & (numFiles as text) & " untitled files : " & return & return
-
- set fileNum to 1
- repeat until fileNum is greater than numFiles
-
- tell application "UltraFind 2.1"
- copy (the name of fileRecord fileNum) to fName
- copy (the fileKind of fileRecord fileNum) to fKind
- end tell
-
- -- The Display Dialog routine cannot more than 255 characters so...
- set addText to (fileNum as text) & ". " & fKind & " ╥" & fName & "╙" & return
- if (length of addText) + (length of dialogText) is less than 190 then
- set dialogText to dialogText & addText
- else
- set dialogText to dialogText & return & "(..and more..)" & return
- set fileNum to numFiles
- end if
-
- set fileNum to fileNum + 1
-
- end repeat
-
- set dialogText to dialogText & return & "Do you want to trash these files?"
- if the button returned of (display dialog dialogText buttons {"Yes", "No"} default button "No") is "Yes" then
-
- set myWasteBasket to ("Galileo:Trash" as alias)
- repeat with fileNum from 1 to numFiles
- tell application "UltraFind 2.1"
- copy (the accessPath of fileRecord fileNum) to fName
- end tell
- set aliasList to (fName as alias) as list
- tell application "Finder"
- -- NOTE If using Finder 7.1.2 this may need modifying
- move to myWasteBasket from aliasList -- NOTE: un-comment for use with Finder 7.1.2
- end tell
- end repeat
-
- set dialogText to (numFiles as text) & " items were trashed!" & return & return ┬
- & "Do you want me to empty the wastebasket now?"
-
- if the button returned of (display dialog dialogText buttons {"Yes", "No"} default button "No") is "Yes" then
- tell application "Finder"
- empty trash
- end tell
- end if
-
- end if
- end if
- tell application "UltraFind 2.1" to quit
-